<section>
	<div class="page-header">
		<h2><?php echo $title; ?></h2>
	</div>
	
	<?php echo form_open('', array('autocomplete' => 'off')); ?>
		<div class="clearfix">
			<label>Name <span class="req">*</span></label>
			<div class="input">
				<input type="text" name="category_name" />
			</div>
		</div>
		<div class="clearfix">
			<label>Type</label>
			<div class="input">
				<?php echo show_array_dropdown($categories, 'content_category_id', 'name', '', 'cat'); ?>
			</div>
		</div>
		<div class="clearfix">
			<label>Parent Category</label>
			<div class="input">
				<select name="category" id="category"></select>
			</div>
		</div>
		<div class="actions">
			<button type="submit" class="btn primary">Save</button>
			<?php echo anchor('contents/content_categories', 'Cancel', array('class' => 'btn')); ?>
		</div>
	</form>
</section>

<script>
	$('#cat').change(function() {
		
		var typ = $(this);
		var val = $(this).val();
		
		showChildren('<?php echo site_url('contents/ajax_list_parent_categories'); ?>/' + val, '');

	});	
</script>